Instructions for replication of analysis presented in Jonathan Pinckney and Claire Trilling
"Breaking Down Pillars of Support for Democratic Backsliding" (2024). 
Mobilization: An International Quarterly, Forthcoming.

To run the analysis requires installation of R 4.1.1 and 
RStudio "Cranberry Hibiscus" Release (c8fc7aee, 2024-09-16)

All files and folders in the replication Zip file should be extracted
to the same folder in order for the below scripts to work as intended.
In particular, the rds file "analysis-datasets.rds" should be kept in a 
sub-folder entitled "data" and a "figures" sub-folder kept for figures 
and tables to output to.

######################################################################
*** I. Install Dependencies *** 
######################################################################

(1) Please begin by installing the following R packages, available from
CRAN, used in the analysis.

- bookdown_0.41
- tidyverse_2.0.0
- marginaleffects_0.23.0
- modelsummary_2.2.0
- sandwich_3.1-1
- lmtest_0.9-40
- texreg_1.39.4
- kableExtra_1.4.0
- broom_1.0.7

######################################################################
*** II. Main Text Analysis *** 
######################################################################

Running the main-article-analysis.R script will produce all figures and
tables in the manuscript, as well as specific in-text references to the data.

######################################################################
*** III. Appendix Analysis *** 
######################################################################

The supplemental appendix is stored in the pillars-appendix.rmd file.
To replicate the full appendix, including all tables and figures, the
file should be output to pdf using the "knit" function. Note that the 
specific format of the appendix is pdf_document2, a format from the 
"bookdown" package, and thus requires installation of the bookdown 
package, even though bookdown is not called in the markdown file itself. 

